// module name: distributors
// author: yangtao2019
// date: 2021.07.12

`timescale 1ns / 1ps

// 1 to 2 dsitributor
module one2twodistor(
    input code,
    input[63:0] data_in,
    output[63:0] data_out0,
    output[63:0] data_out1
);

    assign data_out0 = (code==1'b0) ? data_in : 64'b0;
    assign data_out1 = (code==1'b1) ? data_in : 64'b0;

endmodule

// 1 to 4 dsitributor
module one2fourdistor(
    input[1:0] code,
    input[63:0] data_in,
    output[63:0] data_out0,
    output[63:0] data_out1,
    output[63:0] data_out2,
    output[63:0] data_out3
);

    assign data_out0 = (code==2'd0) ? data_in : 64'b0;
    assign data_out1 = (code==2'd1) ? data_in : 64'b0;
    assign data_out2 = (code==2'd2) ? data_in : 64'b0;
    assign data_out3 = (code==2'd3) ? data_in : 64'b0;

endmodule